#include<string>
#include<vector>
#include<iostream>
using namespace std;
vector<int> singleNumber(vector<int>& nums) {
    if (nums.size() == 2) {
        return nums;
    }
    int xorsum = 0;
    for (int num : nums) {
        xorsum ^= num;
    }
    xorsum = (xorsum == INT_MIN ? xorsum : xorsum & (-xorsum));
    int x = 0, y = 0;
    for (auto ch : nums) {
        int z = ch & xorsum;
        if (z) {
            x ^= ch;
        }
        else {
            y ^= ch;
        }
    }
    return { x, y };
}
int main()
{
    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(1);
    v.push_back(3);
    v.push_back(2);
    v.push_back(5);
    singleNumber(v);
    return 0;
}
